/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("FJDetail",Enums.ActionPermissionOptions.Search)]
 */
using iMES.Custom.IRepositories;
using iMES.Custom.IServices;
using iMES.Custom.Services;
using iMES.Entity.DomainModels;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace iMES.Custom.Controllers
{
    public partial class FJDetailController
    {
        private readonly IFJDetailService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
		private readonly IFJDetailRepository _fJDetailRepository;

		[ActivatorUtilitiesConstructor]
        public FJDetailController(
            IFJDetailService service,
            IHttpContextAccessor httpContextAccessor,
			IFJDetailRepository fJDetailRepository
		)
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
			_fJDetailRepository = fJDetailRepository;

		}


		/// <summary>
		/// 获取流程节点数据源(用户与角色)
		/// </summary>
		/// <returns></returns>
		[AllowAnonymous]
		[HttpGet, Route("getFJDetail")]
		public async Task<IActionResult> getFJDetail()
		{

			var users = await _fJDetailRepository.FindAsIQueryable(x => true).Select(s => new { key = s.id, value = s.size }).ToListAsync();

			return Json(users);
		}
	 

	}
}
